-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create barbican keystone listener deployment #34
Create barbican keystone listener deployment #34
Conversation
64f9074
to
707b197
Compare
a2233ee
to
22e3c2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll want to add Owns(&barbicanv1beta1.BarbicanKeystoneListener{})
to the SetupWithManager()
func
} | ||
|
||
// Add a finalizer to prevent user from manually removing child BarbicanAPI | ||
controllerutil.AddFinalizer(deployment, helper.GetFinalizer()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're adding a finalizer to the BarbicanKeystoneListener
resource, we will also need to remove the finalizer in our deletion logic. i.e. like we do here for the BarbicanAPI
resource that this Barbican
resource owns:
barbican-operator/controllers/barbican_controller.go
Lines 367 to 382 in ed7f9a3
// Remove finalizers from any existing child GlanceAPIs | |
barbicanAPI := &barbicanv1beta1.BarbicanAPI{} | |
err = r.Get(ctx, types.NamespacedName{Name: fmt.Sprintf("%s-api", instance.Name), Namespace: instance.Namespace}, barbicanAPI) | |
if err != nil && !k8s_errors.IsNotFound(err) { | |
return ctrl.Result{}, err | |
} | |
if err == nil { | |
if controllerutil.RemoveFinalizer(barbicanAPI, helper.GetFinalizer()) { | |
err = r.Update(ctx, barbicanAPI) | |
if err != nil && !k8s_errors.IsNotFound(err) { | |
return ctrl.Result{}, err | |
} | |
util.LogForObject(helper, fmt.Sprintf("Removed finalizer from BarbicanAPI %s", barbicanAPI.Name), barbicanAPI) | |
} | |
} |
22e3c2c
to
b0449e3
Compare
// API endpoint | ||
//APIEndpoints map[string]string `json:"apiEndpoint,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove these lines - no api endpoint
type BarbicanKeystoneListenerStatus struct { | ||
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster | ||
// Important: Run "make" to regenerate code after modifying this file | ||
// ReadyCount of barbican API instances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
barbican keystone listener
controllers/barbican_controller.go
Outdated
// TODO(afaranha): Rename Keystone with Barbican | ||
// We need to allow all KeystoneEndpoint and KeystoneService processing to finish | ||
// in the case of a delete before we remove the finalizers. For instance, in the | ||
// case of the Memcached dependency, if Memcached is deleted before all Keystone | ||
// cleanup has finished, then the Keystone logic will likely hit a 500 error and | ||
// thus its deletion will hang indefinitely. | ||
for _, finalizer := range instance.Finalizers { | ||
// If this finalizer is not our KeystoneAPI finalizer, then it is either | ||
// a KeystoneService or KeystoneEndpointer finalizer, which indicates that | ||
// there is more Keystone processing that needs to finish before we can | ||
// allow our DB and Memcached dependencies to be potentially deleted | ||
// themselves | ||
if finalizer != helper.GetFinalizer() { | ||
return ctrl.Result{}, nil | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain to me what this code is supposed to be doing?
envVars := map[string]env.Setter{} | ||
envVars["KOLLA_CONFIG_STRATEGY"] = env.SetValue("COPY_ALWAYS") | ||
envVars["CONFIG_HASH"] = env.SetValue(configHash) | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets get rid of the commented out parts here. we'll have to figure out probes for these kinds of objects (listener, worker) later, but they won't be these kinds of probes
args := []string{"-c"} | ||
if instance.Spec.Debug.Service { | ||
args = append(args, common.DebugCommand) | ||
//livenessProbe.Exec = &corev1.ExecAction{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
//readinessProbe.Exec = livenessProbe.Exec | ||
} else { | ||
args = append(args, ServiceCommand) | ||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Env: env.MergeEnvs([]corev1.EnvVar{}, envVars), | ||
VolumeMounts: barbican.GetLogVolumeMount(), | ||
Resources: instance.Spec.Resources, | ||
//ReadinessProbe: readinessProbe, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
@@ -21,13 +21,13 @@ interface = internal | |||
{{ end }} | |||
|
|||
[keystone_notifications] | |||
enable = false | |||
enable = true | |||
topic = notifications |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we decided to use topic = barbican_notifications so that barbican would get its own listening queue
#driver=messagingv2 | ||
driver=noop | ||
driver=messagingv2 | ||
#driver=noop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits and a change for the topic to barbican_notifications
73d7383
to
44ff70b
Compare
44ff70b
to
ed1aa45
Compare
No description provided.